<style>

ul, menu, dir {
    display: block;
    list-style-type: disc;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    -webkit-padding-start: 40px;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.site-doc-color li {
    display: inline-block;
    vertical-align: middle;
    width: 180px;
    margin-left: 20px;
    margin-bottom: 20px;
    padding: 20px 10px;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    line-height: 22px;
    font-size: 14px;
}

</style>

<div id="content" style="background-color:#ffffff">
<div id="content-header">
  <div id="breadcrumb"> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> <a href="#" class="tip-bottom">商家管理</a><a href="#" class="current">开票统计</a> </div>
</div>
<div class="container-fluid" >
  
  <div class="row-fluid" >
  
<blockquote class="layui-elem-quote">余票统计</blockquote>
	  
    <ul class="site-doc-color">
      <li style="background-color: #009688;">
        <p>剩余余票</p><p>
        </p><p tips=""><{if $left_count.leftInvoiceNum}><{$left_count.leftInvoiceNum}><{else}>0<{/if}></p>
      </li>
     
    </ul>
<div class="site-tips site-text">
  
   
<form class="layui-form " action="?m=admin&o=ticket&t=statistics&id=<{$gvar.fget.id}>" method="get">
     <input type='hidden' name='m' value='admin'>
     <input type='hidden' name='o' value='ticket'>
     <input type='hidden' name='t' value='statistics'>
     <input type='hidden' name='id' value='<{$gvar.fget.id}>'>
    <label class="layui-form-label">开票统计</label>
    <div class="layui-input-inline">
      <select name="year">
       	 <{foreach item=v from=$year}>
        	 <option value="<{$v}>"<{if $v==$gvar.fget.year}>selected<{/if}> ><{$v}>年</option>
       	 <{/foreach}>
      </select>
    
    </div>
    <div class="layui-input-inline">
      <select name="month">
        <{foreach item=v from=$month}>
        	 <option value="<{$v}>" <{if $gvar.fget.month}><{if $v==$gvar.fget.month}>selected<{/if}><{else}><{if $v==date('m')}>selected<{/if}><{/if}>><{$v}>月</option>
       	 <{/foreach}>
      </select>
    
    </div>
   <button type='submit' class="layui-btn layui-btn-normal" style="background-color:#FF5722">搜索</button>

</form> 
 
</div>
    <ul class="site-doc-color">
    
     <li style="background-color:  #393D49;">
        <p>提交开票量</p><p>
        </p><p tips=""><{$tongji.totalCount}></p>
      </li>
      <li style="background-color:#5FB878;">
        <p>成功开票量</p><p>
        </p><p tips=""><{$tongji.totalSuccCount}></p>
      </li>
      <li style="background-color: #1E9FFF;">
        <p>开票总金额</p><p>
        </p><p tips=""><{$tongji.totalMoney}></p>
      </li>
    </ul>
  </div>
</div>
<script>
layui.use(['layer','form'], function(){
 	var layer = layui.layer;
    var form = layui.form()
 	$(".create-ticket").click(function(){
		var shop_id = $(this).attr('shop_id');
		layer.prompt({title: '请输入开票金额，并确认', formType: 0}, function(data, index){
			 $.ajax({
			   type: "POST",
			   url: "index.php?m=admin&o=ticket&t=ajaxCreateTicket",
			   data: "price="+data+"&shop_id="+shop_id,
			   success: function(msg){
				 if(msg==0){
					layer.close(index);
					layer.alert('创建失败！');	 
				 }else{
					layer.close(index);
					layer.open({
						title:'二维码',
						area: ['350px', '450px'],
						content:"<a target='_blank' href='http://weixin_online/app/index.php?i=3&c=entry&do=open_ticket&m=xf_ticket&number="+$.trim(msg)+"'>开票地址</a><br><img src='http://qr.liantu.com/api.php?text=http://weixin.xiangfubao.com.cn/app/index.php?i=3%26c=entry%26do=open_ticket%26m=xf_ticket%26number="+$.trim(msg)+"'>"	
				
					}) 
				 }
			   }
			});
		});
	
	})
  

	
	$(".del").click(function(){
		var url = $(this).attr('d_href');
		layer.confirm('您确定要删除？', {
		  btn: ['确定','取消'] //按钮
		}, function(){
			 location.href=url;
		}, function(){
			layer.closeAll()
		});	
	
	})
	


});
</script>